package com.lizy.order03.web;

import com.lizy.order03.stock.StockService;
import com.lizy.order03.product.ProductService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/order03")
public class Order03Controller {

    @Resource
    StockService stockService;
    @Resource
    ProductService productService;

    @RequestMapping("/add")
    public String add() {
        //远程调用仓库服务
        String message = stockService.getStock();
        //远程调用产品服务
        String product = productService.getProduct();
        return "下单成功，stockMessage=" + message + " productMessage="+ product;
    }
}
